Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

221
Visualizações
Stand-alone React 18 page warning: importing createRoot from "react-dom"

I'm trying to create a stand-alone webpage that uses React 18:

<!DOCTYPE html>
<html lang="en">
   <head>
      <title>Hello React!</title>
      <script crossorigin src="https://unpkg.com/react@18/umd/react.development.js"></script>
      <script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>
      <script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"></script>
   </head>
   <body>
      <div id="root"></div>

      <script type="text/babel">
      
      const root = ReactDOM.createRoot(document.getElementById("root"));
      root.render(<h1>Hello React!</h1>);
         
      </script>
   </body>
</html>

Although the page technically works, I see this error message in the console:

Warning: You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".

I'm not sure what to change in my script tags since I'm using the suggested CDN links. I would have thought a file called react-dom-client.development.js would exist, but I don't see it:

https://unpkg.com/browse/react-dom@18.0.0/cjs/

Any suggestions?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can ignore this warning. A fix is coming: https://github.com/facebook/react/issues/24292#issuecomment-1091690844

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda